//
//  BaseTableViewController.swift
//  SwiftSina
//
//  Created by 七 on 2017/4/17.
//  Copyright © 2017年 Apple. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController, VisitorViewDelegaate {

    //定义一个变量保存用户当前是否登录
    var userLogin = true
    var visitV: VisitorView?
    override func loadView() {
        super.loadView()
        userLogin ? super.loadView() : setupVisitorView()
        
    }
    
    fileprivate func setupVisitorView(){
        let visitorView = VisitorView()
        visitorView.backgroundColor = .white
        visitorView.delegate = self
        view = visitorView
        visitV = visitorView
        //设置导航栏未登录按钮
//        navigationController?.navigationBar.tintColor = .orange
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: .plain, target: self, action: #selector(registerBtnClick))
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: .plain, target: self, action: #selector(loginBtnClick))
    }
    func loginBtnClick() {
        print("点击登录")
    }
    func registerBtnClick() {
        print("点击注册")
    }
}
